<template>
  <!-- 生产计划订单跟踪 -->
  <div class="centerThree">
    <h1>生产计划订单跟踪</h1>
    <el-row class="tables">
      <!-- 表格 头部 -->
      <el-row class="tableTh">
        <el-col :span="4">
          <span>计划单号</span>
        </el-col>
        <el-col :span="3">
          <span>产品代码</span>
        </el-col>
        <el-col :span="3">
          <span>产品名称</span>
        </el-col>
        <el-col :span="3">
          <span>规格型号</span>
        </el-col>
        <el-col :span="3">
          <span>计划数量</span>
        </el-col>
        <el-col :span="3">
          <span>完工数量</span>
        </el-col>
        <el-col :span="3">
          <span>合格数</span>
        </el-col>
        <el-col :span="3">
          <span>完工进度</span>
        </el-col>
        <el-col :span="3">
          <span>合格率</span>
        </el-col>
        <el-col :span="4">
          <span>计划完成时间</span>
        </el-col>
      </el-row>
      <!-- 表格行 -->
      <div v-if="tableData.length > 0" class="showDiv">
        <el-row v-for="(item,index) in tableData" :key="item.id" :class="{ 'row-striped': index % 2 === 0 }" class="tableTd">
          <el-col :span="4">
            <span>{{ item.planNo }}</span>
          </el-col>
          <el-col :span="3">
            <span>{{ item.materialCode }}</span>
          </el-col>
          <el-col :span="3">
            <span>{{ item.materialName }}</span>
          </el-col>
          <el-col :span="3">
            <span>{{ item.unit || '&nbsp;&nbsp;' }}</span>
          </el-col>
          <el-col :span="3">
            <span>{{ item.planNum || 0 }}</span>
          </el-col>
          <el-col :span="3">
            <span>{{ item.finishNum || 0 }}</span>
          </el-col>
          <el-col :span="3">
            <span>{{ item.qualifiedNum || 0 }}</span>
          </el-col>
          <el-col :span="3">
            <span>{{ item.finishRate || 0 }}</span>
          </el-col>
          <el-col :span="3">
            <span>{{ item.qualifiedRate || 0 }}</span>
          </el-col>
          <el-col :span="4">
            <span>{{ item.deliveryDate }}</span>
          </el-col>
        </el-row>
      </div>
      <div v-else class="kong">暂无数据</div>
    </el-row>
  </div>
</template>
<script>
export default {
  props: {
    tableData: {
      type: Array,
      default: []
    }
  },
  data() {
    return {}
  },
  watch: {},
  mounted() {},
  methods: {}
}
</script>
<style lang='scss' scoped>
.centerThree {
  height: 33.333%;
  padding: 10px 10px 10px 10px;
  h1 {
    font-size: 18px;
    color: #fff;
    height: 35px;
    font-weight: normal;
    margin: 0;
  }
  .row-striped {
    background-color: #3788ff; /* 背景色可以根据需要自定义 */
  }
  .tables {
    height: calc(100% - 35px);
    // padding: 0 10px 0 10px;
    color: #fff;
    background: rgba(55, 136, 255, 0.2);
    .showDiv {
      height: calc(100% - 37px);
    }
    .tableTh,
    .tableTd {
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
      .el-col {
        text-overflow: ellipsis; /*让截断的文字显示为点点。还有一个值是clip意截断不显示点点*/
        white-space: nowrap; /*让文字不换行*/
        overflow: hidden; /*超出要隐藏*/
      }
    }
    .tableTh {
      width: 100%;
      height: 20%;
      font-weight: bold;
      font-size: 0.8vw;
    }
    .tableTd {
      height: 18.5%;
      line-height: 100%;
      // padding: 5%;
      font-size: 0.8vw;
      font-weight: bold;
    }
    .kong {
      height: calc(100% - 65px);
      // background: url(../../../../assets/images/zwsj.png) no-repeat center;
      background-size: 50% auto;
      display: flex;
      align-items: center;
      justify-content: center; /*定义body的里的元素水平居中*/
      color: #fff;
      font-size: 0.8vw;
    }
  }
}
</style>
